package org.example.DesignPatterns.Flyweight;

/**
 * @description:
 * @author: farprt
 * @create: 2022-09-18 14:49
 **/
public class Grass implements Drawable{
    //类内部即将共享的”元“数据
    private String image;

    public Grass(){
        this.image="Grass";
        System.out.println("从磁盘加载["+image+"]图片，耗时半秒......");
    }

    @Override
    public void draw(int x, int y) {
        System.out.println("在位置["+x+":"+y+"]绘制图片:["+image+"]");
    }
}